﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniErp.Entity.DataStreams.DOs.AssetManagement
{
    /// <summary>
    /// 资产信息实体
    /// </summary>
    [Table("AssetInfo")]
    public class AssetInfo : BaseEntity
    {
        /// <summary>
        /// 资产总编号
        /// </summary>
        public string AllId { get; set; }
        /// <summary>
        /// 资产编号
        /// /// </summary>
        [MaxLength(5, ErrorMessage = "资产编号长度为5位数"), MinLength(5, ErrorMessage = "资产编号长度为5位数")]
        [ConcurrencyCheck]
        public int AId { get; set; }
        /// <summary>
        /// 资产名
        /// </summary>
        [MaxLength(20, ErrorMessage = "资产名必须小于20位字符"), Required]
        public string AssetName { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }



        #region 导航属性
        /// <summary>
        /// 工号
        /// </summary>
        [MaxLength(6), MinLength(6)]
        public int UserInfoId { get; set; }
        public virtual UserInfo UserInfo { get; set; }
        /// <summary>
        /// 资产总类型编号
        /// </summary>
        [MaxLength(4), MinLength(4)]
        public int GeneralTypeId { get; set; }
        public virtual GeneralType GeneralType { get; set; }
        /// <summary>
        /// 资产次级类型编号
        /// </summary>
        [MaxLength(4), MinLength(4)]
        public int SecondaryTypeId { get; set; }
        public virtual SecondaryType SecondaryType { get; set; }
        /// <summary>
        /// 资产状态编号
        /// </summary>
        [MaxLength(1)]
        public int AssetStateId { get; set; }
        public virtual AssetState AssetState { get; set; }
        /// <summary>
        /// 位置编号
        /// </summary>
        [MaxLength(6)]
        public int PositionId { get; set; }
        public virtual Position Position { get; set; }
        /// <summary>
        /// 部门编号
        /// </summary>
        [MaxLength(6)]
        public int DepartmentId { get; set; }
        public virtual Department Department { get; set; }
        #endregion
    }
}
